﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

class GameQueue : MonoBehaviour
{
    public static GameQueue Instance { get; private set; }

    public List<Action> ActionQueue;

    void Awake()
    {
        Instance = this;
        ActionQueue = new List<Action>();
    }

    public void QueueAction(Action action)
    {
        ActionQueue.Add(action);
    }

    void FixedUpdate()
    {
        foreach (Action a in ActionQueue)
            a.Invoke();
    }
}
